<template>
  <div style="position: relative">
    <div style="position: sticky;top: 0;z-index: 999;padding-top: 20px;background-color: white;padding-bottom: 20px">
      <div class="table_Header">
        <el-row :gutter="24">
          <el-col :span="16">
            <div class="justify_left">
              <span class="table_HeaderTitle">标题</span>
            </div>
          </el-col>
          <el-col :span="2">
            <div class="align_items">
              <span class="table_HeaderTitle">守护人数</span>
            </div>
          </el-col>
          <el-col :span="2">
            <div class="align_items">
              <span class="table_HeaderTitle">人口数</span>
            </div>
          </el-col>
          <el-col :span="2">
            <div class="align_items">
              <span class="table_HeaderTitle">未读人数</span>
            </div>
          </el-col>
        </el-row>
      </div>
    </div>
    <div class="table_List" v-for="item in warehouseForm" v-if="warehouseForm.length != 0">
      <div style="padding: 10px">
        <el-row :gutter="24">
          <el-col :span="16">
            <div class="align_items shop_Height">
              <span class="table_ContentTitle" style="text-align: left">{{item.name}}</span>
            </div>
          </el-col>
          <el-col :span="2">
            <div class="align_items shop_Height">
              <span class="table_ContentTitle" style="text-align: center">{{item.hits}}</span>
            </div>
          </el-col>
          <el-col :span="2">
            <div class="align_items shop_Height">
              <span class="table_ContentTitle" style="text-align: center">{{item.people}}</span>
            </div>
          </el-col>
          <el-col :span="2">
            <div class="align_items shop_Height">
              <span class="table_ContentTitle" style="text-align: center">{{item.unreadNumber}}</span>
            </div>
          </el-col>
        </el-row>
      </div>
    </div>
    <div v-if="warehouseForm.length == 0" style="display: flex;justify-content: center">
      <span style="color: grey;padding-bottom: 20px">暂无数据</span>
    </div>


  </div>
</template>

<script>
  export default {
    data() {
      return {}
    },
    props: [
      'warehouseForm'
    ],
    methods: {
      detailsClick(id) {
        this.$emit('detailsClick', id)
      },

      watchShippingMethod(val){
        if (val == 0) {
          return this.$t('saleout.componentsList.watchShippingMethod[0]')
        } else if (val == 1) {
          return this.$t('saleout.componentsList.watchShippingMethod[1]')
        } else if (val == 2) {
          return this.$t('saleout.componentsList.watchShippingMethod[2]')
        }
      },
      warehouseType(val) {
        if (val == 1) {
          return this.$t('saleout.componentsList.warehouseType[0]')
        } else if (val == 2) {
          return this.$t('saleout.componentsList.warehouseType[1]')
        } else if (val == 3) {
          return this.$t('saleout.componentsList.warehouseType[2]')
        } else if (val == 4) {
          return this.$t('saleout.componentsList.warehouseType[3]')
        } else if (val == 5) {
          return this.$t('saleout.componentsList.warehouseType[4]')
        } else if (val == 6) {
          return this.$t('saleout.componentsList.warehouseType[5]')
        } else if (val == 7) {
          return this.$t('saleout.componentsList.warehouseType[6]')
        } else if (val == 8) {
          return this.$t('saleout.componentsList.warehouseType[7]')
        }
      },
      status(val) {
        if (val == 0) {
          return this.$t('saleout.componentsList.status[0]')
        } else if (val == 1) {
          return this.$t('saleout.componentsList.status[1]')
        } else if (val == 2) {
          return this.$t('saleout.componentsList.status[2]')
        } else if (val == 3) {
          return this.$t('saleout.componentsList.status[3]')
        }
      }
    },
    filters: {},
  }
</script>

<style scoped>
  .table_Header {
    width: 100%;
    background-color: #f5f7fa;
    padding: 10px;
  }

  .table_HeaderTitle {
    font-size: 12px;
    color: #353535;
    font-weight: 600;
  }

  .table_List {
    width: 100%;
    margin-bottom: 20px;
    border: 1px solid #f2f2f2;
  }

  .table_ListHeader {
    width: 100%;
    padding: 10px;
    background-color: #f5f7fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .table_ListHeaderTitle {
    font-size: 12px;
    color: #888888;
  }

  .align_items {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .justify_left {
    display: flex;
    align-items: center;
  }

  .justify_right {
    display: flex;
    align-items: center;
    justify-content: flex-end;
  }

  .table_ContentTitle {
    font-size: 12px;
    color: #353535;
    width: 100%;
    text-align: center;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .shop_Height {
    min-height: 30px;
  }

  .details_Title {
    font-size: 14px;
    color: #409EFF;
  }
</style>
